const filter = {
    userNickSplitFun: function (val) {
        if (val) {
            if (val.length > 2) {
                return val.slice(val.length - 2, val.length);
            } else {
                return val;
            }
        } else {
            return "无";
        }
    },
    baseTimeFun: function (val) {
        if (val) {
            var standardTime = new Date(Number(val));
            var y, m, d, h, f;
            y = standardTime.getFullYear();
            m = standardTime.getMonth() + 1;
            m = m > 9 ? m : "0" + m;
            d = standardTime.getDate();
            d = d > 9 ? d : "0" + d;
            h = standardTime.getHours();
            h = h > 9 ? h : "0" + h;
            f = standardTime.getMinutes();
            f = f > 9 ? f : "0" + f;
            return y + "-" + m + "-" + d + " " + h + ":" + f;
        } else {
            return "暂无";
        }
    },
    baseDateFun: function (val) {
        if (val) {
            var standardTime = new Date(Number(val));
            var y, m, d, h, f;
            y = standardTime.getFullYear();
            m = standardTime.getMonth() + 1;
            m = m > 9 ? m : "0" + m;
            d = standardTime.getDate();
            d = d > 9 ? d : "0" + d;
            h = standardTime.getHours();
            h = h > 9 ? h : "0" + h;
            f = standardTime.getMinutes();
            f = f > 9 ? f : "0" + f;
            return y + "." + m + "." + d;
        } else {
            return "暂无";
        }
    },
    baseStrFun: function (val) {
        if (val) {
            return val;
        } else {
            return "暂无";
        }
    }
};
export default filter;
